Зачем [[nodiscard]] нужен не только для возврата значения
Если ты думаешь, что [[nodiscard]] — это просто защита от игнора Result, то вот фокус: его можно вешать и на классы, и на функции, и даже на enum — и это реально помогает избежать багов.
void check_connection(const Connection& conn) { conn.is_valid(); // warning: result of 'is_valid' is unused }
📌 Даже если функция возвращает bool — компилятор предупредит, если ты его проигнорируешь. Это круто, когда метод что-то проверяет, ищет или сигналит об ошибке — и ты точно не хочешь забыть проверить результат.
⚠️ Но аккуратно: [[nodiscard]]не бросает исключения и не делает функцию безопасной. Это подсказка компилятору и твой напарник по коду.
Если хочешь писать более надёжный и самодокументируемый код — юзай [[nodiscard]] не только по дефолту, а осознанно.
Зачем [[nodiscard]] нужен не только для возврата значения
Если ты думаешь, что [[nodiscard]] — это просто защита от игнора Result, то вот фокус: его можно вешать и на классы, и на функции, и даже на enum — и это реально помогает избежать багов.
void check_connection(const Connection& conn) { conn.is_valid(); // warning: result of 'is_valid' is unused }
📌 Даже если функция возвращает bool — компилятор предупредит, если ты его проигнорируешь. Это круто, когда метод что-то проверяет, ищет или сигналит об ошибке — и ты точно не хочешь забыть проверить результат.
⚠️ Но аккуратно: [[nodiscard]]не бросает исключения и не делает функцию безопасной. Это подсказка компилятору и твой напарник по коду.
Если хочешь писать более надёжный и самодокументируемый код — юзай [[nodiscard]] не только по дефолту, а осознанно.
Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.
Export WhatsApp stickers to Telegram on iPhone
You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.